//
//  UILabel+Extension.swift
//  weibo10
//
//  Created by mac on 15/10/18.
//  Copyright © 2015年 itheima. All rights reserved.
//

import UIKit

extension UILabel{
    convenience init(title: String, titleColor: UIColor = UIColor.darkGrayColor(), fontSize: CGFloat = 14,inset:CGFloat = 0){
        self.init()
        text = title
        textColor = titleColor
        font = UIFont.systemFontOfSize(fontSize)
        
        // 换行
        numberOfLines = 0
        if inset != 0 {
           textAlignment = NSTextAlignment.Left
            preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - CGFloat(2 * statusCellMargin)
        }else{
            // 文字居中
            textAlignment = NSTextAlignment.Center
        }
    }
}
